package com.zq.learing.base;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * @Author: zhaoqi
 * @Date: 2020/4/12 11:34 反射
 * @Version 1.0
 */

public class MethodInvokeTest {

    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        String s = "asdasda";
        Method toUpperCase = s.getClass().getMethod("toUpperCase");
        System.out.println(toUpperCase.invoke(s));


    }

}
